import axios from 'axios'
import Vue from 'vue'

const instance = axios.create({
// 隐藏
  timeout: 10000
})

instance.interceptors.request.use(config => {
  if (!config.params) config.params = {}
  // console.log(window.sessionStorage.getItem('token'))
  if (!config.params.cookie) config.params.cookie = window.sessionStorage.getItem('cookie')
  // if (!config.params.cookie) config.params.cookie = cookie.value
  return config
}, error => {
  console.log(error)
})

Vue.prototype.$http = instance
